package com.example.helloworld;

public class RunoobTest2 {
    //
//    private int age;
//    public String content = "hello";
//    public static void main(String[] args) {
//        RunoobTest2 myrunoob = new RunoobTest2();
//        myrunoob.age = 20;
//        System.out.println(myrunoob.age);
//    }
    // 私有变量，仅在该类可见
    private String name;
    // 这个成员变量对子类可见
    public double salary;

    public RunoobTest2(String name){
        this.name = name;
    }

    class RunoobTest3{
        public String getName(){
            return name;
        }
        public double getSalary(){
            return salary;
        }
    }

//    设置salary
    public void setSalary(double salary){
        this.salary = salary;
    }

    // 打印信息
    public void printEmp(){
        System.out.println("名字 : " + name );
        System.out.println("薪水 : " + salary);
    }

    public static void main(String[] args) {
        RunoobTest2 myrunoob = new RunoobTest2("小邓");
        RunoobTest2.RunoobTest3 myrunoob3  = myrunoob.new RunoobTest3();
        String name = myrunoob3.getName();
        System.out.println(name);
//        myrunoob.setSalary(5000);
//        myrunoob.printEmp();
    }

}
